Skip to content

Adjustments for running hub in non-priv/non-systemd container #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

craigcomstock
Copy link
Contributor

@craigcomstock craigcomstock commented May 19, 2025

  • Added hostname package dependency for rpm hub package
  • Added better check for systemd presence

Build Status

Verified

This commit was signed with the committer’s verified signature.
craigcomstock Craig Comstock
For UBI container images this package/command is not installed by default so require it as the installation scriptlets need it.

Ticket: ENT-12995

Verified

This commit was signed with the committer’s verified signature.
craigcomstock Craig Comstock
For example, an ubi9 container image contains systemctl command that will fail always because systemd is not started.

Ticket: ENT-12653
Changelog: none
@cf-bottom
Copy link

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@craigcomstock craigcomstock marked this pull request as ready for review May 27, 2025 15:22
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins please

@cf-bottom
Copy link

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -14,6 +14,10 @@ Url: https://cfengine.com
BuildRoot: %{_topdir}/%{name}-%{version}-%{release}-buildroot
Obsoletes: cfengine3 < @@VERSION@@, cf-community < @@VERSION@@
Requires: coreutils

# installation scriptlets need hostname command, not present in UBI container images
Requires: hostname
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should/could do /bin/hostname here instead, but it's probably just the same in the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Yeah, I wasn't sure how Requires works. I asked gemini and the summary is basically:

So, while the hostname.spec file doesn't explicitly state Provides: /usr/bin/hostname, the rpmbuild process, via the find-provides script and the rpmdeps binary, automatically adds that capability to the final .rpm package.

Because https://git.centos.org/rpms/hostname/blob/c8s/f/SPECS/hostname.spec doesn't have a Provides: but does include an executable so included in what it provides and would work with Requires. I hesitate to use /bin/hostname as maybe it might get moved to a different path like /sbin/hostname. Unlikely but it feels to me like just the package name is pretty good. I don't believe that rpm will flexibly look for any executable path ending in hostname.

@craigcomstock craigcomstock merged commit ca497dd into cfengine:master Jun 5, 2025
@craigcomstock craigcomstock deleted the ENT-12653-0/master branch June 5, 2025 15:53
@craigcomstock
Copy link
Contributor Author

I won't cherry pick this right away since master will become next LTS and this change probably needs to "bake" a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants